package org.exez.modules.visitor.constant;

/**
 * 身份证类型
 *
 * @author dtm
 */
public enum IdentityTypeEnum {
    IDENTITY_CARD("IDENTITY_CARD", 1,"身份证"),
    PASSPORT("PASSPORT", 2,"护照");
    private String name;
    private Integer index;
    private String value;

    private IdentityTypeEnum(String name, Integer index, String value) {
        this.name = name;
        this.index = index;
        this.value = value;
    }

    public static String getName(Integer index) {
        for (IdentityTypeEnum c : IdentityTypeEnum.values()) {
            if (c.getIndex().equals(index)) {
                return c.name;
            }
        }
        return null;
    }
    public static String getValue(Integer index) {
        for (IdentityTypeEnum c : IdentityTypeEnum.values()) {
            if (c.getIndex().equals(index)) {
                return c.value;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }


    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
